﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BlackStar;
using Microsoft.Xna.Framework;

namespace BlackStarTest
{
    public class LoginForm : GameComponent
    {
        Form formComponent;
        Textbox username;
        Textbox password;
        Button login;
        Button cancel;

        public LoginForm(Game game, GUI g, string componentName)
            :base (game)
        {
            formComponent = (Form)g.FindComponent(componentName);
            username = (Textbox)formComponent.FindComponent("TextboxUsername");
            password = (Textbox)formComponent.FindComponent("TextboxPassword");
            login = (Button)formComponent.FindComponent("ButtonLogin");
            cancel = (Button)formComponent.FindComponent("ButtonCancel");

            cancel.Click += new ComponentEvent(cancel_Click);
        }

        void cancel_Click(Component sender)
        {
            this.Game.Exit();            
        }

    }
}
